package com.fengke.dao.model;

import java.math.BigDecimal;
import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;

public class MemberModel extends BaseEntity {
	private static final long serialVersionUID = 60176854696697250L;
	/** 性别 */
	public enum Gender {
		/** 男 */
		male(0),
		/** 女 */
		female(1);
		
		private int gender;
		Gender(int gender) {
			this.gender = gender;
		}
		public int getGender() {
			return this.gender;
		}
	}
	public enum LoginType {
		/** QQ */
		QQ(0),
		/** 微博 */
		blog(1);
		private int type;
		LoginType(int type) {
			this.type = type;
		}
		public int getType() {
			return this.type;
		}
	}
	/**
	 * 情感状态
	 */
	public enum MaritalStatus {
		/** 保密*/
		secretive(0),
		/** 单身 */
		single(1),
		/** 恋爱中*/
		inLove(2),
		/** 已婚 */
		married(3);
		private int status;
		MaritalStatus(int status) {
			this.status = status;
		}
		public int getStatus() {
			return this.status;
		}
	}
	/** 用户名 */
	private String username;
	/** 密码 */
	private String password;
	/** E-mail */
	private String email;
	/** 积分 */
	private Long point;
	/** 消费金额 */
	private BigDecimal amount;
	/** 余额 */
	private BigDecimal balance;
	/** 是否启用 */
	private Boolean isEnabled;
	/** 是否锁定 */
	private Boolean isLocked;
	/** 是否注册用户购物 */
	private Boolean isRegistShopping;
	/** 连续登录失败次数 */
	private Integer loginFailureCount;
	/** 锁定日期 */
	private Date lockedDate;
	/** 注册IP */
	private String registerIp;
	/** 最后登录IP */
	private String loginIp;
	/** 最后登录日期 */
	private Date loginDate;
	/** 姓名 */
	private String name;
	/** 第三方登录类型 */
	private LoginType loginType;
	private Integer mloginType;
	/** 第三方用户id */
	private String openId;
	private String unionId;
	private String headImgUrl;
	/** 微信用户id */
	private String weiXinOpenId;
	private String memo;
	/** 性别 */
	private Gender gender;
	private Integer mgender;
	/** 出生日期 */
	private Date birth;
	/** 地址 */
	private String address;
	/** 邮编 */
	private String zipCode;
	/** 电话 */
	private String phone;
	/** 手机 */
	private String mobile;
	/** 会员等级 */
	private MemberRankModel memberRankModel;
	/** 职业 */
	private String industry;
	/** 学校 */
	private String school;
	/** 家乡 */
	private String hometown;
	/** 爱好 */
	private String hobby;
	/** 情感状态 */
	private MaritalStatus maritalStatus;
	private Integer mmaritalStatus;
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public Long getPoint() {
		return point;
	}
	public void setPoint(Long point) {
		this.point = point;
	}
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	public BigDecimal getBalance() {
		return balance;
	}
	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}
	public Boolean getIsEnabled() {
		return isEnabled;
	}
	public void setIsEnabled(Boolean isEnabled) {
		this.isEnabled = isEnabled;
	}
	public Boolean getIsLocked() {
		return isLocked;
	}
	public void setIsLocked(Boolean isLocked) {
		this.isLocked = isLocked;
	}
	public Boolean getIsRegistShopping() {
		return isRegistShopping;
	}
	public void setIsRegistShopping(Boolean isRegistShopping) {
		this.isRegistShopping = isRegistShopping;
	}
	public Integer getLoginFailureCount() {
		return loginFailureCount;
	}
	public void setLoginFailureCount(Integer loginFailureCount) {
		this.loginFailureCount = loginFailureCount;
	}
	public Date getLockedDate() {
		return lockedDate;
	}
	public void setLockedDate(Date lockedDate) {
		this.lockedDate = lockedDate;
	}
	public String getRegisterIp() {
		return registerIp;
	}
	public void setRegisterIp(String registerIp) {
		this.registerIp = registerIp;
	}
	public String getLoginIp() {
		return loginIp;
	}
	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}
	public Date getLoginDate() {
		return loginDate;
	}
	public void setLoginDate(Date loginDate) {
		this.loginDate = loginDate;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public LoginType getLoginType() {
		return loginType;
	}
	public void setLoginType(LoginType loginType) {
		this.loginType = loginType;
	}
	public String getOpenId() {
		return openId;
	}
	public void setOpenId(String openId) {
		this.openId = openId;
	}
	public String getUnionId() {
		return unionId;
	}
	public void setUnionId(String unionId) {
		this.unionId = unionId;
	}
	public String getHeadImgUrl() {
		return headImgUrl;
	}
	public void setHeadImgUrl(String headImgUrl) {
		this.headImgUrl = headImgUrl;
	}
	public String getWeiXinOpenId() {
		return weiXinOpenId;
	}
	public void setWeiXinOpenId(String weiXinOpenId) {
		this.weiXinOpenId = weiXinOpenId;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	public Gender getGender() {
		return gender;
	}
	public void setGender(Gender gender) {
		this.gender = gender;
	}
	public Date getBirth() {
		return birth;
	}
	public void setBirth(Date birth) {
		this.birth = birth;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getZipCode() {
		return zipCode;
	}
	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public Integer getMgender() {
		if(this.gender == null) {
			return null;
		}
		this.mgender = this.gender.getGender();
		return mgender;
	}
	public void setMgender(Integer mgender) {
		if(mgender == null) {
			return ;
		}
		if(mgender == Gender.male.getGender()) {
			this.gender = Gender.male;
		} else if(mgender == Gender.female.getGender()) {
			this.gender = Gender.female;
		}
		this.mgender = this.gender.getGender();
	}
	public Integer getMloginType() {
		if(this.loginType == null) {
			return null;
		}
		this.mloginType = this.loginType.getType();
		return mloginType;
	}
	public void setMloginType(Integer mloginType) {
		if(mloginType == null) {
			return ;
		}
		if(mloginType == LoginType.QQ.getType()) {
			this.loginType = LoginType.QQ;
		} else if(mloginType == LoginType.blog.getType()) {
			this.loginType = LoginType.blog;
		}
		this.mloginType = this.loginType.getType();
	}
	public MemberRankModel getMemberRankModel() {
		return memberRankModel;
	}
	public void setMemberRankModel(MemberRankModel memberRankModel) {
		this.memberRankModel = memberRankModel;
	}
	public String getIndustry() {
		return industry;
	}
	public void setIndustry(String industry) {
		this.industry = industry;
	}
	public String getSchool() {
		return school;
	}
	public void setSchool(String school) {
		this.school = school;
	}
	public String getHometown() {
		return hometown;
	}
	public void setHometown(String hometown) {
		this.hometown = hometown;
	}
	public String getHobby() {
		return hobby;
	}
	public void setHobby(String hobby) {
		this.hobby = hobby;
	}
	public MaritalStatus getMaritalStatus() {
		return maritalStatus;
	}
	public void setMaritalStatus(MaritalStatus maritalStatus) {
		this.maritalStatus = maritalStatus;
	}
	public Integer getMmaritalStatus() {
		if(this.maritalStatus == null) {
			return null;
		}
		this.mmaritalStatus = this.maritalStatus.getStatus();
		return mmaritalStatus;
	}
	public void setMmaritalStatus(Integer mmaritalStatus) {
		if(mmaritalStatus == null) {
			return ;
		}
		if(mmaritalStatus == MaritalStatus.secretive.getStatus()) {
			this.maritalStatus = MaritalStatus.secretive;
		} else if(mmaritalStatus == MaritalStatus.single.getStatus()) {
			this.maritalStatus = MaritalStatus.single;
		} else if(mmaritalStatus == MaritalStatus.inLove.getStatus()) {
			this.maritalStatus = MaritalStatus.inLove;
		} else if(mmaritalStatus == MaritalStatus.married.getStatus()) {
			this.maritalStatus = MaritalStatus.married;
		}
		this.mmaritalStatus = this.maritalStatus.getStatus();
	}
}
